<template>
  <div>
    <!-- table -->
    <!-- 现场人员信息记录 - 现场人员处理过程新增 -->
    <FormPanel ref="formPanel1" :list="formList" :cols="1" :formType="'add'" labelWidth="110" :isSubmitBtn="false" @formChange="formChangeHandle" />
    <div style="margin-bottom: 1rem;"></div>

    <div style="padding-top: 3rem;"></div>
    <div
      :style="{
        position: 'absolute',
        left: 0,
        bottom: 0,
        right: 0,
        zIndex: 9,
        borderTop: '1px solid #e9e9e9',
        padding: '10px 20px',
        background: '#fff',
        textAlign: 'right'
      }"
    >
      <multiuse-button type="primary" @click="saveDialog">添 加</multiuse-button>
      <multiuse-button @click="closeDialog">关 闭</multiuse-button>
    </div>
  </div>
</template>
<script>
// import res from '@/mock/tableData';

export default {
  // mixins: [dictionary],
  components: {

  },
  data() {
    return {
      visibleDrawer: false,
      collapse: false,
      infoId: null,
      // topFilterInit: this.topFilterInitFun(),
      // fetchApi: getUser,
      fetchParams: {}, //ipa 接口
      selectedRows: [], //选中经销商
      formList: this.createFormList(),
      saveData: null
    };
  },
  created() {
  },
  methods: {
    createFormList() {
      return [
        {
          type: 'INPUT',
          label: '进度',
          fieldName: 'speedPro',
          placeholder: '请选择状态',
          rules: [{required: true, message: '请选择状态', trigger: 'change'}],
        },
        {
          type: 'INPUT',
          label: '维修经过',
          fieldName: 'cmsClaimProcess',
          placeholder: '请输入维修经过...',
          rules: [{ required: true, message: '请输入维修经过', trigger: 'blur' }]
        },
        {
          type: 'DATE',
          label: '日期',
          fieldName: 'siteDate',
          valueFormat: 'yyyy-MM-dd',
          dateType: 'datetime',
          placeholder: '选择日期',
          rules: [{ required: true, message: '请选择日期', trigger: 'change' }]
        }
      ];
    },
    formChangeHandle(val) {
      console.log(val);
      this.saveData = val;
    },
    //搜索获取数据
    changeHandle(val) {
      this.fetchParams = val;
      console.log(val);
    },
    //选中
    selectChange(rows) {
      this.selectedRows = rows;
      console.log(this.selectedRows);
    },
    //保存
    saveDialog() {
      this.$refs.formPanel1.SUBMIT_FORM();
      if (this.saveData){
        this.$emit('save', this.saveData);
      }
    },
    //取消操作
    closeDialog() {
      this.$emit('close', {visible: false, data: this.selectedRows, type: 'close'});
    },
    chooseOrderNo() {
      this.visible = true;
    },
    close(){
      this.visible = false;
    }
  }
};
</script>

<style lang="less" scoped></style>
